function Person(name,age) {
    if(new.target === undefined) {
        throw new Error('需要使用 new 调用构造函数');
    }
    this.name = name;
    this.age = age;
}

let p1 = new Person('daixa',18);
let p2 = Person('daxia',16);

console.log(p1);
console.log(p2);